{% extends 'base' %}
{% block main %}
<div class="container">
  <div class="row table-responsive ">
    <table class="table table-bordered">
      <thead>
      <tr>
        <th>Queue</th>
        <th>Concurrency</th>
        <th>Retry Count</th>
        <th>Visibility Timeout</th>
        <th>Dead Letter queues</th>
        <th>Pause/Unpause</th>
        <th>Created On</th>
        <th>Updated On</th>
      </tr>
      </thead>
      <tbody>
      {% for meta in queues %}
      <tr>
        <td><a href="queues/{{meta.name}}">{{meta.name}}</a></td>
        <td>{{meta.concurrency.min}},{{meta.concurrency.max}}</td>
        <td>{{meta.numRetry}}</td>
        <td>{{meta.visibilityTimeout}}</td>
        <td>
          {{ dlq(meta.deadLetterQueues) }}
        </td>
        <td class="text-center">
          <i data-toggle="tooltip" data-placement="top" title="{% if meta.paused %}Unpause{% else %}Pause{% endif %}"
             class="bx pause-queue-btn {% if meta.paused %} bx-play-circle  {% else %} bx-pause-circle {% endif %}"
             data-queue="{{meta.name}}"></i>
        </td>
        <td>{{ time(meta.createdOn) }}</td>
        <td>{{ time(meta.updatedOn) }}</td>
      </tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
</div>
<div class="container">
  {% for config in queueConfigs %}
  <div class="row">
    <h2>{{config.key}}</h2>
    <table class="table table-bordered">
      <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Size</th>
      </tr>
      </thead>
      <tbody>
      {% for meta in config.value %}
      <tr>
        <td> {{ meta.key }}</td>
        <td> {{ meta.value.name }}</td>
        <td> {{ meta.value.size }}</td>
      </tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
  {% endfor %}
</div>
{% endblock %}
